const MyBaseController = require('./MyBaseController');

// const {
// 	Controller
// } = require('egg');

class TipsController extends MyBaseController {
   
  
    async random() {
        const result = await this.service.tips.random();
        this.success(result)
    }

    async addTips() {
        let tips =  this.ctx.request.body;
        tips.create_time=this.app.mysql.literals.now
        const result = await this.app.mysql.insert('tips',tips);
        this.success(result)
    }

}

module.exports = TipsController;